package com.baofu.paycore.service.processor.preAuth;

import com.baofu.paycore.manager.model.preAuth.PreAuthBO;
import com.baofu.paycore.service.converter.DTO2BOConverter;
import com.baofu.paycore.service.facade.model.authorize.AuthorizeDTO;
import com.baofu.paycore.service.processor.PayBaseProcessor;
import org.springframework.stereotype.Component;

/**
 * 预授权主单处理类
 *
 * <p>
 *  1.构建预授权主单
 * </p>
 * User: xin deng  Date: 16/8/30 ProjectName: paycore Version: 1.0
 */
@Component
public class PreAuthProcessor implements PayBaseProcessor<PreAuthBO, AuthorizeDTO> {

    /**
     * 支付内部对象构建
     *
     * @param payBaseBO  支付模型
     * @param payBaseDTO 请求参数
     */
    @Override
    public PayBaseProcessor process(PreAuthBO payBaseBO, AuthorizeDTO payBaseDTO) {
        DTO2BOConverter.payBaseBOConverter(payBaseDTO, payBaseBO);
        DTO2BOConverter.preAuthDTOToBO(payBaseDTO, payBaseBO);
        return this;
    }
}
